CREATE TABLE [dbo].[TDMOVI_CATB]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_CAJA] [dbo].[TD_VC_008] NOT NULL,
[AA_CAJA] [dbo].[TD_VC_004] NOT NULL,
[MM_CAJA] [dbo].[TD_VC_002] NOT NULL,
[TI_MOVI] [dbo].[TD_VC_001] NOT NULL,
[NU_COMP_CAJA] [dbo].[TD_VC_008] NOT NULL,
[NU_SECU] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TDMOVI_CA__NU_SE__6D823440] DEFAULT ((0)),
[CO_EMPR_DEST] [dbo].[TD_VC_002] NULL,
[CO_BANC_DEST] [dbo].[TD_VC_003] NULL,
[NU_CNTA_DEST] [dbo].[TD_VC_020] NULL,
[AA_BNCO_DEST] [dbo].[TD_VC_004] NULL,
[MM_BNCO_DEST] [dbo].[TD_VC_002] NULL,
[TI_MOVI_DEST] [dbo].[TD_VC_001] NULL,
[NU_COMP_DEST] [dbo].[TD_VC_008] NULL,
[CO_TIPO_OPER] [dbo].[TD_VC_003] NULL,
[CO_TIPO_DOCU] [dbo].[TD_VC_003] NULL,
[NU_DOCU_BANC] [dbo].[TD_VC_020] NULL,
[FE_OPER] [dbo].[TD_DT_001] NULL,
[FE_DISP] [dbo].[TD_DT_001] NULL,
[FA_TIPO_CAMB] [dbo].[TD_NU_015_006] NOT NULL CONSTRAINT [DF__TDMOVI_CA__FA_TI__6E765879] DEFAULT ((1.000)),
[IM_MOVI] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TDMOVI_CA__IM_MO__6F6A7CB2] DEFAULT ((0)),
[IM_CONV] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TDMOVI_CA__IM_CO__705EA0EB] DEFAULT ((0)),
[TI_MOVI_OPER] [dbo].[TD_VC_003] NULL,
[CO_CNTA_EMPR] [dbo].[TD_VC_020] NULL,
[TI_ENTI] [dbo].[TD_VC_001] NULL,
[CO_ENTI] [dbo].[TD_VC_020] NULL,
[TI_DOCU] [dbo].[TD_VC_003] NULL,
[NU_DOCU] [dbo].[TD_VC_020] NULL,
[CO_ORDE_SERV] [dbo].[TD_VC_020] NULL,
[DE_OBSE] [dbo].[TD_VC_100] NULL,
[CO_GRUP_CONC] [dbo].[TD_VC_020] NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NULL,
[CO_SUBR] [dbo].[TD_VC_003] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDMOVI_CA__CO_US__7152C524] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDMOVI_CA__FE_US__7246E95D] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDMOVI_CA__CO_US__733B0D96] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDMOVI_CA__FE_US__742F31CF] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDMOVI_CATB] ADD CONSTRAINT [PK__TDMOVI_C__728CABD37F96C2DA] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_CAJA], [AA_CAJA], [MM_CAJA], [TI_MOVI], [NU_COMP_CAJA], [NU_SECU]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDMOVI_CATB] ADD CONSTRAINT [FK__TDMOVI_CATB__595C0B59] FOREIGN KEY ([CO_EMPR], [CO_CAJA], [AA_CAJA], [MM_CAJA], [TI_MOVI], [NU_COMP_CAJA]) REFERENCES [dbo].[TCMOVI_CAJA] ([CO_EMPR], [CO_CAJA], [AA_CAJA], [MM_CAJA], [TI_MOVI], [NU_COMP_CAJA])
GO
ALTER TABLE [dbo].[TDMOVI_CATB] ADD CONSTRAINT [FK__TDMOVI_CATB__5A502F92] FOREIGN KEY ([CO_EMPR], [CO_TIPO_OPER]) REFERENCES [dbo].[TTTIPO_OPER] ([CO_EMPR], [CO_TIPO_OPER])
GO
